package com.edu.springboot.service.impl;


import com.edu.springboot.domain.Student;
import com.edu.springboot.mapper.StudentMapper;
import com.edu.springboot.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *  业务层接口实现
 *  业务层依赖于数据访问层
 */

@Service
public class StudentServiceImpl  implements StudentService {

    @Autowired
    private StudentMapper studentMapper;
    @Override
    public List<Student> select() {
        return this.studentMapper.select();
    }

    @Override
    public Student selectById(Integer stid) {
        return this.studentMapper.selectById(stid);
    }

    @Override
    public void deleteById(Integer stid) {

         this.studentMapper.deleteById(stid);
    }

    @Override
    public void insert(Student student) {
        this.studentMapper.insert(student);
    }

    @Override
    public void updateById(Student student) {
        this.studentMapper.updateById(student);
    }
}
